import request from '@/utils/request'

// 查询用户账号列表
export function listUser(query) {
  return request({
    url: '/consumer/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户账号详细
export function getUser(userId) {
  return request({
    url: '/consumer/user/' + userId,
    method: 'get'
  })
}

// 新增用户账号
export function addUser(data) {
  return request({
    url: '/consumer/user',
    method: 'post',
    data: data
  })
}

// 修改用户账号
export function updateUser(data) {
  return request({
    url: '/consumer/user',
    method: 'put',
    data: data
  })
}

// 删除用户账号
export function delUser(userId) {
  return request({
    url: '/consumer/user/' + userId,
    method: 'delete'
  })
}

//获取当前登陆用户的companyId
export function getCompanyId() {
  return request({
    url: 'api/user/getCompanyId',
    method: 'get'
  })
}

//查询本公司的车队经理
export function getFleetManager(companyId) {
  return request({
    url: 'api/driverManager/queryManagerByCompanyId',
    method: 'get',
    params: { companyId }
  })
}

//查询本公司的车队长
export function getFleetLeader(companyId) {
  return request({
    url: 'api/driverManager/queryCarLeaderByCompanyId',
    method: 'get',
    params: { companyId }
  })
}



